package com.ruoyi.web.xjgj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.web.xjgj.domain.CameraAlarmInfo;
import com.ruoyi.web.xjgj.mapper.CameraAlarmInfoMapper;
import com.ruoyi.web.xjgj.service.ICameraAlarmInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 摄像头告警消息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-19
 */
@Service
public class CameraAlarmInfoServiceImpl implements ICameraAlarmInfoService
{
    @Autowired
    private CameraAlarmInfoMapper cameraAlarmInfoMapper;

    /**
     * 查询摄像头告警消息
     *
     * @param id 摄像头告警消息主键
     * @return 摄像头告警消息
     */
    @Override
    public CameraAlarmInfo selectCameraAlarmInfoById(Long id)
    {
        return cameraAlarmInfoMapper.selectCameraAlarmInfoById(id);
    }

    /**
     * 查询摄像头告警消息列表
     *
     * @param cameraAlarmInfo 摄像头告警消息
     * @return 摄像头告警消息
     */
    @Override
    public List<CameraAlarmInfo> selectCameraAlarmInfoList(CameraAlarmInfo cameraAlarmInfo)
    {
        return cameraAlarmInfoMapper.selectCameraAlarmInfoList(cameraAlarmInfo);
    }

    /**
     * 新增摄像头告警消息
     *
     * @param cameraAlarmInfo 摄像头告警消息
     * @return 结果
     */
    @Override
    public int insertCameraAlarmInfo(CameraAlarmInfo cameraAlarmInfo)
    {
        cameraAlarmInfo.setCreateTime(DateUtils.getNowDate());
        return cameraAlarmInfoMapper.insertCameraAlarmInfo(cameraAlarmInfo);
    }

    /**
     * 修改摄像头告警消息
     *
     * @param cameraAlarmInfo 摄像头告警消息
     * @return 结果
     */
    @Override
    public int updateCameraAlarmInfo(CameraAlarmInfo cameraAlarmInfo)
    {
        cameraAlarmInfo.setUpdateTime(DateUtils.getNowDate());
        return cameraAlarmInfoMapper.updateCameraAlarmInfo(cameraAlarmInfo);
    }

    /**
     * 批量删除摄像头告警消息
     *
     * @param ids 需要删除的摄像头告警消息主键
     * @return 结果
     */
    @Override
    public int deleteCameraAlarmInfoByIds(Long[] ids)
    {
        return cameraAlarmInfoMapper.deleteCameraAlarmInfoByIds(ids);
    }

    /**
     * 删除摄像头告警消息信息
     *
     * @param id 摄像头告警消息主键
     * @return 结果
     */
    @Override
    public int deleteCameraAlarmInfoById(Long id)
    {
        return cameraAlarmInfoMapper.deleteCameraAlarmInfoById(id);
    }
}
